package br.com.danilloguimaraes.test.entidade;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.OneToMany;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.jpa.activerecord.RooJpaActiveRecord;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooJpaActiveRecord
public class Pessoa {

    @NotNull
    @Column(unique = true)
    @Size(min = 3, max = 30)
    private String nome;

    @OneToMany(cascade = CascadeType.ALL)
    private Set<Veiculo> veiculos = new HashSet<Veiculo>();
}
